#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define ep emplace
#define rep(i, x, y) for(int i = (x); i <= (y); i++) 
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;

ll read() {
	ll x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-', ch = getchar(); 
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar(); return f ? -x : x;
}

const int N = 1e5 + 10;

ll b[70], a[N], S, ans;
int id[70], n, vans[N];
bitset < N > t[70];

void ins(ll x) {
	per(i, 62, 0) if(x >> id[i] & 1ll) {
		if(!b[id[i]]) { b[id[i]] = x; return; }
		else x ^= b[id[i]];
	}
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in; rep(i, 1, n) S ^= (a[i] = in);
	rep(i, 0, 62) id[i] = i;
	sort(id, id + 63, [](auto x, auto y) { return (S >> x & 1ll) ^ (S >> y & 1ll) ? (S >> x & 1ll) > (S >> y & 1ll) : x < y; });
	rep(i, 1, n) ins(a[i]);
	per(i, 62, 0) {
		int x = id[i];
		if(S >> x & 1ll) {
			if(ans >> x & 1ll) ans ^= b[x];
		} else if(!(ans >> x & 1ll)) ans ^= b[x];
	}
	a[++n] = ans;
	rep(i, 1, n) rep(j, 0, 62) if(a[i] >> j & 1ll) t[j].set(i);
	rep(i, 0, 62) {
		pii v = { 1e9, 1e9 };
		rep(j, i, 62) if(t[j].any()) v = min(v, { t[j]._Find_first(), j });
		if(v.fi == 1e9) break;
		if(v.se ^ i) swap(t[v.se], t[i]);
		rep(j, 0, 62) if(j ^ i && t[j].test(v.fi)) t[j] ^= t[i];
	}
	rep(i, 1, n - 1) vans[i] = 2;
	rep(i, 0, 62) if(t[i].any() && t[i][n]) vans[t[i]._Find_first()] = 1;
	rep(i, 1, n - 1) printf("%d ", vans[i]);
	return 0;
}
